#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main(int argc, char const *argv[])
{

        int num = 3;
        char fileName[128] = {0};
        while (1){
                sprintf(fileName,"temp_%04d", num++);
                if(open(fileName, O_RDONLY|O_CREAT,0666) < 0){
                        perror("open err");
                        break;
                }
        }
        printf("num == %d\n", num);
        return 0;
}